Skip to content

Conversation

@ivandika3
Copy link
Contributor

What changes were proposed in this pull request?

Similar to HDDS-7764, we need to update this to prevent expired multipart upload being cleaned up prematurely.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-11221

How was this patch tested?

Update existing unit tests.

@ivandika3 ivandika3 requested review from jojochuang and szetszwo July 24, 2024 01:26

final long expiredCreationTimestamp =
Instant.now().minus(expireThreshold).toEpochMilli();
expireThreshold.negated().plusMillis(Time.now()).toMillis();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/HDDS-7764 lists going to Time.now() as a temporary solution. We should switch to UTC time and not be dependent on local time zone configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review. I agree with switching from Time.now() to Instant.now() (which will be addressed in HDDS-7911). However, currently the issue is that OmKeyInfo creationTimestamp and modificationTimestamp already using Time.now(). If we switch to Instant.now() instead, the timestamps in the key / file table will be a mix of UTC and local time zone.

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

@ivandika3 ivandika3 self-assigned this Jul 26, 2024
@ivandika3 ivandika3 requested a review from kerneltime July 29, 2024 03:54
@ivandika3 ivandika3 merged commit dd831d8 into apache:master Jul 30, 2024
@ivandika3
Copy link
Contributor Author

Thanks @kerneltime @szetszwo for the reviews.

@ivandika3 ivandika3 deleted the HDDS-11221 branch February 23, 2025 09:13
ivandika3 added a commit to ivandika3/ozone that referenced this pull request Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants